{% macro render_field(field) %}
  <dt>{{ field.label }}:
  <dd>{{ field(**kwargs)|safe }}
  {% if field.errors %}
    <ul class=errors>
    {% for error in field.errors %}
      <li>{{ error }}</li>
    {% endfor %}
    </ul>
  {% endif %}
  </dd>
{% endmacro %}
<!-- <a href="{{ url_for('signup') }}">注册</a> -->
<form method="POST">
    {{ form.csrf_token }}
    {{ render_field(form.username) }}
    {{ render_field(form.password) }}
    {% if emsg %}
        <h3> {{ emsg }}</h3>
    {% endif %}
    <input type="submit" value="登录">
</form>